# This file is subject to a 1-clause BSD license.
# Its contents can be found in the enclosed LICENSE file.

DEBUG=0
REVISION=notabug.org/mouz/bot/app.VersionRevision

ifeq ($(DEBUG),1)
 DATE=`date +%s`
 LDFLAGS="      -X $(REVISION)=$(DATE)"
else
 DATE=`git log -1 --format=%ct`
 LDFLAGS="-w -s -X $(REVISION)=$(DATE)"
endif


install: build
	go install -ldflags $(LDFLAGS)

build:
	go build -ldflags $(LDFLAGS)

all: build install

clean:
	go clean
